package com.xquant.trade.utils;

/**
 * @Auther: B946
 * @Date: 04/03/2020 10:28
 * @Description:
 */
public class ResponseVo {


    private Integer errorCode;

    private String errorMsg;

    private String point;

    private String sole;

    private Object result;

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public String getPoint() {
        return point;
    }

    public void setPoint(String point) {
        this.point = point;
    }

    public String getSole() {
        return sole;
    }

    public void setSole(String sole) {
        this.sole = sole;
    }

    public static ResponseVo success() {
        ResponseVo rv = new ResponseVo();
        rv.setErrorCode(0);
        rv.setErrorMsg("");
        rv.setResult(null);
        return rv;
    }

    public static ResponseVo success(Object result) {
        ResponseVo rv = new ResponseVo();
        rv.setErrorCode(0);
        rv.setErrorMsg("");
        rv.setResult(result);
        return rv;
    }


    public static ResponseVo failure(String msg) {
        ResponseVo rv = new ResponseVo();
        rv.setErrorCode(-1);
        rv.setErrorMsg(msg);
        return rv;
    }

    public static ResponseVo failure(String msg, Integer code) {
        ResponseVo rv = new ResponseVo();
        rv.setErrorCode(code);
        rv.setErrorMsg(msg);
        return rv;
    }

    public static ResponseVo failure(Integer code) {
        ResponseVo rv = new ResponseVo();
        rv.setErrorCode(code);
        rv.setErrorMsg(code + "");
        return rv;
    }
}
